//公共webpack配置
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const extractCSS = new ExtractTextPlugin('css/[name].css?[chunkhash:8]');
const ScriptExtHtmlWebpackPlugin =require('script-ext-html-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
const args = require('minimist')(process.argv.slice(2));
const Parame = require('./public/constants');
/*<---------------------------------------------------
------------------------------------------------------>*/

let rules = require('./public/baseRules');
const devServer = require('./public/devServer');


module.exports = {
  output: {
    path: Parame.distPath,
    filename: 'js/[name].js?[hash:8]',
    publicPath: Parame.publicPath,
    chunkFilename: 'chunks/[name].chunk@[id].js?[chunkhash:6]'
  },
  module:{
    rules
  },
  resolve:{
    extensions: ['.jsx', '.js','.scss','.css'],
    alias: {
      globalConfig: path.join(Parame.srcPath, '/config/' + process.env.REACT_WEBPACK_ENV)
    },
    modules:[Parame.srcPath,path.join(Parame.rootPath, './node_modules')] //模块查找目录顺序
  },
  devServer
};
